var profitList = {
	init:function(){
        this.layuiUse();	
        this.profitList();
	},
	layuiUse:function(){
		layui.use(['layer', 'form','jquery'], function(){
            var layer = layui.layer,
                form = layui.form,
                $ = layui.$;
        });
    },
    //资产列表
    profitList:function(){
        layui.use(['flow'], function(){
            var flow = layui.flow;
            //分页
            flow.load({
                elem: '#profitList', 
                done: function(page, next){
                var lis = [];
                $.ajax({
                    type: 'post',
                    url:link+'/mobile/user/profit/list',
                    data:{
                        token:GetCookie('token'),
                        pageNum:page,
                    },
                    dataType: 'json',
                    success: function (res) {
                        console.log(res);
                        if(res.code=='10000'){ 
                            if(res.entity.list.length>0){
                            layui.each(res.entity.list, function(index, item){
                                if(item.opt==1){
                                    optName = '提成';
                                }else if(item.opt==2){
                                    optName = '出局';
                                }
                                lis.push('<li class="layui-col-xs12 layui-row boxShadoweee mt10 radius10 p10 pl20 pr20">'+
                                            '<span class="layui-col-xs6 bold font18">'+optName+'</span>'+
                                            '<span class="layui-col-xs6 bold font22 colorRed alignR">+'+item.amount+'</span>'+
                                            // '<span class="layui-col-xs7 color999 mt10 h20 line20">15210999999 消费 <span class="colorRed">'+item.amount+'</span> 元</span>'+
                                            '<span class="layui-col-xs12 color999 mt10 font12 h20 line20">'+item.addTime+'</span>'+
                                        '</li>');
                            });
                            next(lis.join(''), page < Math.ceil(res.entity.total/10));
                            $('.layui-flow-more').addClass('layui-col-xs12');
                            }else{
                                $('.profitList').html('<p class="colorSystem alignC mt30">暂时没有收益记录哦~</p>');
                            }
                        }else{
                            $('.profitList').html('<p class="colorSystem alignC mt30">系统繁忙，请稍后再试~</p>');
                        }
                    },
                    error:function(res){
                        
                    },
                });
                }
            });
        });
    },
};
profitList.init();

          